\hypertarget{class_wav_file}{
\section{WavFile Class Reference}
\label{class_wav_file}\index{WavFile@{WavFile}}
}


Helper class for reading and writing to a WAV file.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_wav_file_a68b16a6cb36d2e0b26df73f0727b120c}{
\hyperlink{class_wav_file_a68b16a6cb36d2e0b26df73f0727b120c}{WavFile} (const QAudioFormat \&format=QAudioFormat(), qint64 dataLength=0)}
\label{class_wav_file_a68b16a6cb36d2e0b26df73f0727b120c}

\begin{DoxyCompactList}\small\item\em Constructs \hyperlink{class_wav_file}{WavFile}. \item\end{DoxyCompactList}\item 
bool \hyperlink{class_wav_file_a29d656c6d7db027858f700441626ad1d}{readHeader} (QIODevice \&device)
\begin{DoxyCompactList}\small\item\em Reads header from the file given at the {\itshape device\/} parameter. \item\end{DoxyCompactList}\item 
\hypertarget{class_wav_file_a60ac04345064b519435863e29dcab862}{
bool \hyperlink{class_wav_file_a60ac04345064b519435863e29dcab862}{writeHeader} (QIODevice \&device)}
\label{class_wav_file_a60ac04345064b519435863e29dcab862}

\begin{DoxyCompactList}\small\item\em Writes WAV file header to the {\itshape device\/} given at the parameter. \item\end{DoxyCompactList}\item 
\hypertarget{class_wav_file_afd51911a3b7cc36b96547c8795c22467}{
qint64 \hyperlink{class_wav_file_afd51911a3b7cc36b96547c8795c22467}{readData} (QIODevice \&device, QByteArray \&buffer, QAudioFormat outputFormat=QAudioFormat())}
\label{class_wav_file_afd51911a3b7cc36b96547c8795c22467}

\begin{DoxyCompactList}\small\item\em Reads sound data from the {\itshape device\/} to the given {\itshape buffer\/} by using {\itshape outputFormat\/}. \item\end{DoxyCompactList}\item 
\hypertarget{class_wav_file_a3beaf7808df51ea42acfef25e643dade}{
const QAudioFormat \& \hyperlink{class_wav_file_a3beaf7808df51ea42acfef25e643dade}{format} () const }
\label{class_wav_file_a3beaf7808df51ea42acfef25e643dade}

\begin{DoxyCompactList}\small\item\em Gets the audio format of the WAV file. \item\end{DoxyCompactList}\item 
\hypertarget{class_wav_file_aa10e4ecee59a5ee772887e340e527f82}{
qint64 \hyperlink{class_wav_file_aa10e4ecee59a5ee772887e340e527f82}{dataLength} () const }
\label{class_wav_file_aa10e4ecee59a5ee772887e340e527f82}

\begin{DoxyCompactList}\small\item\em Gets the length of sound data from the WAV file. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_wav_file_ac8c778a406fa7c1fafab25e3e7a433f8}{
static qint64 \hyperlink{class_wav_file_ac8c778a406fa7c1fafab25e3e7a433f8}{headerLength} ()}
\label{class_wav_file_ac8c778a406fa7c1fafab25e3e7a433f8}

\begin{DoxyCompactList}\small\item\em Gets the length of header from the WAV file. \item\end{DoxyCompactList}\item 
\hypertarget{class_wav_file_a1d47749a12aefda7db75c8a506e0cbfb}{
static bool \hyperlink{class_wav_file_a1d47749a12aefda7db75c8a506e0cbfb}{writeDataLength} (QIODevice \&device, qint64 dataLength)}
\label{class_wav_file_a1d47749a12aefda7db75c8a506e0cbfb}

\begin{DoxyCompactList}\small\item\em Writes the length of the sound data to WAV file. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_wav_file_aa3d58cd8d815fa45170feb28742f958a}{
QAudioFormat \hyperlink{class_wav_file_aa3d58cd8d815fa45170feb28742f958a}{audioFormat}}
\label{class_wav_file_aa3d58cd8d815fa45170feb28742f958a}

\begin{DoxyCompactList}\small\item\em Audio format of the file. \item\end{DoxyCompactList}\item 
\hypertarget{class_wav_file_a28a219e35cadd2ac7e2a86ff0f7731ba}{
qint64 \hyperlink{class_wav_file_a28a219e35cadd2ac7e2a86ff0f7731ba}{dataBufferLength}}
\label{class_wav_file_a28a219e35cadd2ac7e2a86ff0f7731ba}

\begin{DoxyCompactList}\small\item\em Length of the sound data. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Helper class for reading and writing to a WAV file. Reads header from WAV file and extracts sound format from header. Sound data can be read separately. Header and sound data can be also write to WAV file.

See \href{https://ccrma.stanford.edu/courses/422/projects/WaveFormat/}{\tt https://ccrma.stanford.edu/courses/422/projects/WaveFormat/} 

\subsection{Member Function Documentation}
\hypertarget{class_wav_file_a29d656c6d7db027858f700441626ad1d}{
\index{WavFile@{WavFile}!readHeader@{readHeader}}
\index{readHeader@{readHeader}!WavFile@{WavFile}}
\subsubsection[{readHeader}]{\setlength{\rightskip}{0pt plus 5cm}bool WavFile::readHeader (
\begin{DoxyParamCaption}
\item[{QIODevice \&}]{ device}
\end{DoxyParamCaption}
)}}
\label{class_wav_file_a29d656c6d7db027858f700441626ad1d}


Reads header from the file given at the {\itshape device\/} parameter. 

Returns true if the reading of the header was successfull. 

The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
wavfile.h\item 
wavfile.cpp\end{DoxyCompactItemize}
